<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src = "./jquery.min.js"></script>
    <style>
        *{
            margin: 0;

        }

        .btn-set{
            height:50px;
            width: 200px;
            background-color: pink;
            margin: 0 auto;
            position: relative;
            border-radius: 15px;
            top:30px;
        }

        .btn-set button{
            position: absolute;
            /* float: left; */
            top:10px;
        }

        .btn-set #bss{
            left: 10%;
        }

        .btn-set #bsh{
            left: 40%;
        }

        .btn-set #bst{
            left: 70%;
        }

        .meg{
            background: skyblue;
            height:300px;
            width:200px;
            position: relative;
            top:40px;
            left: 50%;
            margin-left:-100px;
            border-radius:15px;
        }

        .toggle-meg{
            background: rgb(241, 226, 143);
            height:300px;
            width:200px;
            position: relative;
            top:40px;
            left: 50%;
            margin-left:-100px;
            border-radius:15px;
        }
    </style>
</head>
<body>
    <div class = "btn-set">
        <button id = "bss">下滑</button>
        <button id = "bsh">上滑</button>
        <button id = "bst">切换</button>
    </div>
    <div class = "meg"></div>

    <script>
        $(function() {
            $("#bss").click(function(){
                $(".meg").slideDown(1000,function(){
                    alert("你打开聊天对话框");
                });
            })

            $("#bsh").click(function(){
                $(".meg").slideUp(1000,function(){
                    alert("您已关闭聊天对话框");
                });
            })

            $("#bst").click(function(){
                $(".meg").slideToggle(1000);
            })
        })

    </script>
</body>
</html>